return "JUMP TO MARKER BUTTON" & RETURN & RETURN & "A click on the sprite makes the playback head jump to a chosen marker in the same movie. You can choose between:" & RETURN & "-> previous marker" & RETURN & "-> next marker" & RETURN & "-> any named marker in the movie" & RETURN & RETURN & "If more than one marker has the same name as the chosen marker, the playback head will jump to the first marker with that name in the movie. If you need to use duplicate names, try adding a different number of spaces at the end of each, so that they appear the same but are in fact different." & RETURN & RETURN & "This behavior is designed for use with the 'Jump Back Button'. You can set it to record the frame number of the current marker so that the 'Jump Back Button' can subsequently return. NOTE: This feature relies on a global variable: gNavigationButtonList." & RETURN & RETURN & "Use the 'Jump to Movie Button' behavior to jump to a marker in a different movie." & RETURN & RETURN & "PERMITTED MEMBER TYPES" & RETURN & "Graphic members" & RETURN & RETURN & "PARAMETERS:" & RETURN & "* Jump to marker in this movie" & RETURN & "* 'Go to' or 'Play and return'?" & RETURN & "* Remember current marker for Back button" & RETURN & RETURN & "Select 'Remember current marker for Back button' to ensure that the behavior 'remembers' which markers have already been visited." & RETURN & RETURN & "Use the associated 'Jump Back Button' behavior on a separate sprite to return to visited markers in reverse order." & RETURN & RETURN & "ASSOCIATED BEHAVIORS:" & RETURN & "+ Jump to Movie button" & RETURN & "+ Jump Back Button" & RETURN & "+ Jump Forward Button" & RETURN & "+ Push Button (to alter rollover / mouseDown states)"
end
on getBehaviorTooltip
return "Use with graphic members." & RETURN & RETURN & "When you drop this behavior on a sprite," & RETURN & "you will be invited to choose which marker" & RETURN & "in the current movie to jump to on mouseUp." & RETURN & "You can also choose 'previous' or 'next'." & RETURN & RETURN & "Use this behavior with the 'Jump Back Button'" & RETURN & "to allow the user to return to visited" & RETURN & "sequences."
end
on beginSprite me
Initialize(me)
end
on mouseUp me
jump(me)
end
on Initialize me
global gNavigationButtonList
if not getPos([#next, #previous, #loop], myMarker) then
currentMarker = [#frame: marker(0), #movie: the movieName]
gNavigationButtonList.stack.append(currentMarker)
if not gNavigationButtonList.index.getPos(currentMarker) then
gNavigationButtonList.index.append(currentMarker)
end if
gNavigationButtonList.forward = []
end if
if myJumpMode = "Go to" then
case myMarker of
#previous:
go(#previous)
#loop:
go(#loop)
#next:
go(#next)
otherwise:
go(marker(myMarker))
end case
else
case myMarker of
#previous:
play frame marker(-1)
#loop:
play frame marker(0)
#next:
play frame marker(1)
otherwise:
play frame myMarker
end case
end if
end
on ErrorAlert me, theError, Data
behaviorName = string(me)
delete word 1 of behaviorName
delete char -30001 of behaviorName
delete char -30001 of behaviorName
case Data.ilk of
#void:
Data = "<void>"
#symbol:
Data = "#" & Data
end case
case theError of
#getPDL_DuplicateMarkers:
alert("Two or more markers in this movie have the same name. This could lead to confusion if you use this behavior to go to a named marker." & RETURN & RETURN & "Duplicate marker(s) = " & Data)
#markerMissing:
if the runMode = "Author" then
alert("BEHAVIOR ERROR: Frame " & the frame & ", Sprite " & me.spriteNum & RETURN & "Behavior " & behaviorName & RETURN & RETURN & "The chosen marker no longer exists. Choose a valid marker in the Behavior Parmeters dialog." & RETURN & RETURN & "Current marker = " & Data)
end if
abort()
#runtime_DuplicateMarkers:
if the runMode = "Author" then
alert("BEHAVIOR ERROR: Frame " & the frame & ", Sprite " & me.spriteNum & RETURN & "Behavior " & behaviorName & RETURN & RETURN & "The chosen marker does not have a unique name. The playback head will jump to the first marker with this name:" & RETURN & RETURN & "Duplicate marker name = " & Data)
end if
#invalidGlobal:
alert("BEHAVIOR ERROR: Frame " & the frame & ", Sprite " & me.spriteNum & RETURN & "Behavior " & behaviorName & RETURN & RETURN & "Behavior " & behaviorName & " requires a global gNavigationButtonList with the structure:" & RETURN & "[#stack [...], #index: [...], #forward: [...]]" & RETURN & RETURN & "Current value = " & Data)